<template>
  <div>
    <ul>
      <li><router-link to="/contacts/all_contacts">All_contacts</router-link></li>
      <li><router-link to="/contacts/alice">Alice</router-link></li>
      <li><router-link to="/contacts/bob">Bob</router-link></li>
    </ul>
    <button @click="random">随机显示</button>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  data() {
    return {
      arr: ['all_contacts', 'alice', 'bob']
    }
  },
  methods: {
    random() {
      this.$router.push(`/contacts/${this.arr[Math.floor(Math.random() * 3)]}`)
    }
  },
  created() {}
}
</script>

<style lang="scss"></style>
